Environment files in X-Plane are simply cartesian grids, 1 degree in longitude wide and 1 degree in latitude tall, whose filename is the latitude and longitude of the file, where each of the grid point in the cartesian grid has the following information:
x-location of gridpoint (distance east of lower-left corner)
y-location of gridpoint (distance north of lower-left corner)
z-location of gridpoint (elevation above sea-level)
information about the quadrilateral that is associated with the gridpoint
Say you have a tic-tac-toe board.
This is a cartesian grid, 3x3 units.
Each of the 9 quadrilaterals (squares) can be broken down ino 2 triangles.
Imagine setting the elevation of each of the VERTICES (points where lines cross) of the
tic-tac-toe board to some elevation (there are 16 vertices on a tic-tac-toe board, if
you put a frame around the board like a chess board). Now imagine breaking the tic-tac-toe
board down into 18 triangles. (You had 9 squares before. You just represent each square as
2 triangles.) Now scoot the vertices around a bit to keep things interesting... not perfectly
lined up! That is what it is like to generate a scenery file for X-Plane. Notice that every
vertex (EXCEPT the ones on the top and right edges) is the lower-left corner of a quadrilateral
(square). That square is said to be owned by that vertex in X-Plane terminology. When we specify
data about that vertex, we are specifying data about the square that has that vertex as the
square's lower-left corner.
Look at an existing environment file while you read this.
The letter of the file should be an A if the file is generated on an Apple (Macintosh), an I
if the file is generated on an IBM-clone.
The next line should be the file version number. Enter the same version number as in the files
that shipped with your copy of X-Plane. After the number, you may put in any comments desired.
The next line should be the file type, which is 1001. Follow this with any comment.
Then enter the i and j size of the file,which must be 38 and 50 in current versions of X-Plane.
The i-counter is the number of gridpoints in the x (east) direction. The j-counter is the
number of gridpoints in the j (north) direction.
Now comes the data for each gridpoint... all in a line.
Now, for each of the gridpoints in the cartesian grid, enter the following data on a line:
x location in meters (distance east from SW corner of file)
y location in meters (distance north from SW corner of file)
z location (elevation) in meters (from sea level)
0 or 1 division direction...
0 divides the quadrilateral owned by the vertex top left to bottom right
1 divides the quadrilateral owned by the vertex bottom left to top right
the first triangle is the one on the left
the second triangle is the one on the right
0 or 1 wether or not first triangle is water
0 or 1 wether or not second triangle water
0 or 1 wether or not first triangle has an airport touching it
0 or 1 wether or not second triangle has an airport touching it
The ORDER the points are listed in matters, of course. You can tell what the order should be by
looking at the x and y values of the data-points in one of the files that shipped with X-Plane.
We start at the lower left (south-west) corner (0 x 0 y) and work to the east until we have
travelled 1 degree of longitude, then go up (north) a bit and do the whole thing again. Do this
until you get tired of it, then do it a while longer, and you will be done!
After entering the environment geometry, put in a bunch of airports and navaids and stuff.
Here is an example of the airport format:
a 41510 50004 41783 50271 100 1 5000 150 308 30 x 4000 100 257 25 x 0 AAA Drop-In
Here is a description of the airport format:
a this nav device is an airport
41510 east/west distance from lower-left-corner of the environment file to the start of the first runway in meters
50004 north/south distance from lower-left-corner of the environment file to the start of the first runway in meters
41783 east/west distance from lower-left-corner of the environment file to the start of the second runway in meters
50271 north/south distance from lower-left-corner of the environment file to the start of the second runway in meters
100 elevation of airport in meters above mean sea level
1 nav device type
5000 length of first runway in feet
150 width of first runway in feet
308 heading in first runway degrees true
30 runway number
x runway is L/R/neither (x for neither, L for left, R for right)
4000 length of second runway in feet
100 width of second runway in feet
257 heading in second runway degrees true
25 runway number
x runway is L/R/neither (x for neither, L for left, R for right)
0 ILS code... 0 means no ILS's at airport, 1 means ILS to first runway, 2 means ILS to second runway, 3 means ILS's to BOTH runways!
AAA airport identifier
Drop-In airport name
When you enter your airports, make sure everything lines up perfectly and that all the data is there!
Here are the "nav device types" mentioned above:
civil airport = 1
civil/military = 2
military aiport = 3
ndb = 4
vor = 5
outer marker = 6
middle marker = 7
inner marker = 8
ils = 9
loc =10
Here is an example of the NAVAID format:
n 89361 55560 89361 55560 56 4 105 0 0 AAA Macintosh NDB
Here is a description of the NAVAID format:
n nav device is a NAVAID (not airport)
89361 east/west distance to NAVAID part 1, in meters
55560 north/south distance to NAVAID part 1, in meters
0 east/west distance to NAVAID part 2, in meters
0 north/south distance to NAVAID part 2, in meters
56 elevation, above mean sea level
4 NAVAID type
105 frequency integers
0 frequency 100th's
0 heading of NAVAID, degrees true (only matters for ILS and LOC)
AAA NAVAID identifier
Macintosh NDB name of the NAVAID, in this case named after the world's best computer
NAVAID part 1 & 2
for NDB's, VOR's, localizers, and markers, part 1 is the only part you have to worry about... just enter 0
for the other parts... for ILS's, part 1 is the localizer, part 2 is the glideslope.